/*******************************************************************************
main.cpp

Notes:
 - (done bdk) Create a Game object
 - (done bdk) Initialize the Game object
 - (done bdk) Start the Game object
*******************************************************************************/

#ifdef _DEBUG
#pragma comment(lib, "sfml-main-d.lib")
#else
#pragma comment(lib, "sfml-main.lib")
#endif

#include "Game.h"

int main(int argc, char** argv)
{
	// Default values
	int iWidth = 800;
	int iHeight = 600;

#ifdef _DEBUG
	bool bIsFullscreen = false;
#else
	bool bIsFullscreen = true;
#endif

	// Checks command line arguments
	for(int i = 0; i < argc; i++)
	{
		if(0 == strcmp(argv[i], "-windowed"))
		{
			bIsFullscreen = false;
		}
		else if(0 == strcmp(argv[i], "-width"))
		{
			i++;
			iWidth = atoi(argv[i]);
		}
		else if(0 == strcmp(argv[i], "-height"))
		{
			i++;
			iHeight = atoi(argv[i]);
		}
	}

	// Create a game object
	Game game;

	// If the game initializes ok...
	if(game.Initialize(iWidth, iHeight, "Pong", bIsFullscreen))
	{
		// ... start the game and return what it returns
		return game.Start();
	}
	else
	{
		// otherwise, close the program now. There was an error
		return 1;
	}
}